package com.ruicar.afs.cloud.voucher.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.common.core.feign.annotations.AfsFeignClear;
import com.ruicar.afs.cloud.voucher.dto.VoucherSendInfoDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author infinity
 * @version 1.0
 * @description: 对接长城凭证中间库
 * @date 2020/7/2 9:54
 */
@FeignClient(name = "voucher", url = "${com.greatwall.systems.voucher-system.url}")
public interface VoucherApiFeign {
    /**
     * @param list
     * @return
     */
    @ApiOperation("发送凭证中间库API接口")
    @PostMapping(value = "/send")
    @AfsFeignClear(true)
//通过此注解防止添加内部token
    JSONObject send(@RequestBody @Validated List<VoucherSendInfoDto> list);

}
